<!--START JS-->
<i id="scriptTag">/static/js/console/banner.js</i>
<link rel="stylesheet" type="text/css" href="/static/js/plugins/uploadify/uploadify.css" />
<link rel="stylesheet" type="text/css" href="/static/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" >
<link href="/static/css/plugins/footable/footable.core.css" rel="stylesheet">
<!--END JS-->

<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2><?php echo $page_title; ?></h2>
        <p>您可在此进行<?php echo $page_title; ?></p>
    </div>
    <div class="col-lg-2"></div>
</div>

<!--START banner-->
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5><?php echo $page_title; ?></h5>
                </div>
                <div class="ibox-content">
                    <div class="tab-container">
                        <ul class="nav nav-tabs">
                            <li class="active">
                                <a data-toggle="tab" href="#data-list" aria-expanded="true">幻灯片列表</a>	
                            </li>	
                            <li class="">
                                <a data-toggle="tab" href="#add-list" aria-expanded="false">新增幻灯片</a>	
                            </li>	
                        </ul>	
                        <div class="tab-content">
                            <div id="data-list" class="tab-pane active">
                                <div class="panel-body">
                                    <?php if (!$list) { ?>
                                        <h2 class="text-navy text-center">暂无数据...</h2>
                                    <?php } else { ?>
                                        <input type="text" class="form-control input-sm m-b-xs" id="filter" placeholder="Search for sth in table">
                                        <table class="footable table table-stripped toggle-arrow-tiny table-hover" id="data-table" data-page-size="10" data-filter="#filter">
                                            <thead>
                                                <tr>
                                                    <th>图片</th>
                                                    <th>跳转连接</th>
                                                    <th>状态</th>
                                                    <th>创建时间</th>
                                                    <th>操作</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <?php foreach ($list as $item) { ?>
                                                    <tr>
                                                        <td><img src="<?php echo $item['banner_img_url']; ?>" class="img-responsive" style="width:100px;height:50px;"/></td>
                                                        <td><?php echo $item['banner_redirect_url']; ?></td>
                                                        <td><?php echo $item['banner_is_show'] == 1 ? '显示' : '隐藏'; ?></td>
                                                        <td><?php echo date('Y-m-d H:i:s', $item['banner_create_time']); ?></td>
                                                        <td>
                                                            <a class="btn btn-bitbucket btn-primary" href="/console/bannerEdit/<?php echo $item['id']; ?>" title="修改">
                                                                <i class="fa fa-edit"></i>
                                                            </a>
                                                            <a class="del-btn btn btn-bitbucket btn-danger" href="#" title="删除" data-id="<?php echo $item['id']; ?>">
                                                                <i class="fa fa-times"></i>
                                                            </a>
                                                        </td>
                                                    </tr>
                                                <?php } ?>
                                            </tbody>
                                            <tfoot>
                                                <tr>
                                                    <td colspan="4">
                                                        <ul class="pagination pull-right"></ul>
                                                    </td>
                                                </tr>
                                            </tfoot>
                                        </table>
                                    <?php } ?>
                                </div>
                            </div>	
                            <div id="add-list" class="tab-pane">
                                <div class="panel-body">
                                    <div class="form-group" title="点击上传或修改图片" style="min-height:123px;">
                                        <label>图片：</label>
                                        <input type="file" id="file_upload" style="display: none;">
                                        <input type="hidden" value="" id="banner-img">
                                        <div id="banner-img-cover" style="position:absolute;top:142px;">

                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label>跳转连接：(请输入有效的连接地址,若为空则不跳转)</label> 
                                        <input id="banner-redirect" type="text" placeholder="请输入超链接" class="form-control" value="">
                                    </div>
                                    <div class="form-group">
                                        <label>显示：</label>
                                        <div class="radio radio-success radio-inline">
                                            <input type="radio" value="1" checked id="inlineRadio1" name="show"> 
                                            <label for="inlineRadio1">显示</label>
                                        </div>
                                        <div class="radio radio-success radio-inline">
                                            <input type="radio" value="2" id="inlineRadio2" name="show"> 
                                            <label for="inlineRadio2">隐藏</label>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <button id="save-btn" class="btn btn-primary">保存</button>
                                    </div>
                                </div>
                            </div>		
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--END banner-->